#include "ReleaseBuzzer.hpp"

ReleaseBuzzer::ReleaseBuzzer() {
	pinMode(PIN, OUTPUT);
}

ReleaseBuzzer &ReleaseBuzzer::getInstance() {
	static ReleaseBuzzer *instance;

	if (!instance) {
		instance = new ReleaseBuzzer();
	}

	return *instance;
}

bool ReleaseBuzzer::isOpen() const {
	return digitalRead(PIN);
}

void ReleaseBuzzer::open() {
	digitalWrite(PIN, HIGH);
}

void ReleaseBuzzer::close() {
	digitalWrite(PIN, LOW);
}
